package com.prefboss.job.controller;

import com.prefboss.job.service.impl.XxlJobInfoServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/createJob")
public class XxlJobInfoController {

    @Autowired
    @Qualifier("xxlJobInfoServiceImpl")
    private XxlJobInfoServiceImpl xxlJobInfoService;

    @ApiOperation(value = "积分权益规则查询")
    @PutMapping(value = "/autoCreate/{clearRule}")
    public void autoCreateJob(@PathVariable("clearRule") Integer clearRule) {
        xxlJobInfoService.add(clearRule);
    }
}
